<template>
  <div id="baseLayout">
    <a-layout>
      <a-layout-header class="header" v-if="!isNotFound">
        <GlobaHeader></GlobaHeader>
      </a-layout-header>
      <a-layout-content class="content">
        <router-view></router-view>
      </a-layout-content>
      <a-layout-footer class="footer">
        <a href="https://github.com" target="_blank"> GitHub By @F </a>
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<script setup lang="ts">
import GlobaHeader from "@/components/GlobaHeader.vue";
import { ref, watch } from "vue";
import { useRoute } from "vue-router";

const route = useRoute();
const isNotFound = ref(true);
watch(
  () => route.name,
  (val) => {
    if (val === "404") {
      isNotFound.value = true;
    } else {
      isNotFound.value = false;
    }
  }
);
</script>

<style lang="scss" scoped>
#baseLayout {
  .header {
    padding-inline: 20px;
    margin-bottom: 10px;
    background: #fff;
    color: unset;
  }
  .content {
    height: calc(100vh - 150px);
    padding: 20px;
    margin-bottom: 66px;
    background-color: #fff;
    // background: linear-gradient(
    //   to right,
    //   rgba(173, 237, 255, 0.2),
    //   rgba(204, 255, 195, 0.4)
    // );
  }
}
.footer {
  background: #fff;
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  font-weight: 700;
}
</style>
